package com.ziyia.a2_5_4;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ArrayAdapter;
import android.widget.Gallery;
import android.widget.Spinner;

public class MainActivity extends AppCompatActivity {

    private String[] arrays = {"aaa", "bbb", "ccc"};
    private Spinner spinner;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        spinner = findViewById(R.id.spinner);

        ArrayAdapter<String> adapter = new ArrayAdapter<>(this, R.layout.item, arrays);

        spinner.setAdapter(adapter);

    }
}